package com.github.wxiaoqi.security.biz.modules.merchant.rest;

import java.util.Map;

import javax.validation.Valid;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.github.wxiaoqi.security.biz.common.crm.request.QueryApkVersionListRequest;
import com.github.wxiaoqi.security.biz.modules.merchant.biz.ApkVersiontBiz;
import com.github.wxiaoqi.security.biz.modules.merchant.entity.ApkVersion;
import com.github.wxiaoqi.security.common.rest.BaseController;

/**
 * APK版本信息
 * @author yyn
 * @time 创建时间:2019年3月6日下午3:31:36
 * @description
 */
@RestController
@RequestMapping("apkVersionBase")
public class ApkVersionRestController extends BaseController<ApkVersiontBiz, ApkVersion> {
	@Autowired
	private ApkVersiontBiz apkVersiontBiz;
	
	/**
	 * 查询apk版本信息列表
	 * @author yyn
	 * @time 创建时间:2019年3月6日下午3:31:36
	 * @param queryApkVersionListRequest
	 * @return
	 */
	@RequestMapping(value = "/queryList", method = RequestMethod.POST)
    @ResponseBody
	public Map<String, Object> queryList(@RequestBody @Valid QueryApkVersionListRequest queryApkVersionListRequest){
		return apkVersiontBiz.queryList(queryApkVersionListRequest);
	}
	
	/**
	 * 添加一条数据
	 * @author yyn
	 * @time 创建时间:2019年3月6日下午3:31:36
	 * @param queryApkVersionListRequest
	 * @return
	 */
	@RequestMapping(value = "/add",method = RequestMethod.POST)
    @ResponseBody
    public Map<String, Object> add(@RequestBody @Valid QueryApkVersionListRequest queryApkVersionListRequest){
		Map<String, Object> respMap = baseBiz.add(queryApkVersionListRequest);
        return respMap;
    }
	
	/**
	 * 删除一条数据
	 * @author yyn
	 * @time 创建时间:2019年3月6日下午3:31:36
	 * @param id
	 * @return
	 */
	@RequestMapping(value = "/deleteOne/{id}",method = RequestMethod.GET)
    @ResponseBody
    public Map<String, Object> deleteOne(@PathVariable Integer id){
		Map<String, Object> respMap = baseBiz.deleteOne(id);
        return respMap;
    }
	
	
	/**
	 * 更新APK版本信息
	 * @author yyn
	 * @time 创建时间:2019年3月6日下午3:31:36
	 * @param queryApkVersionListRequest
	 * @return
	 */
	@RequestMapping(value = "/updateObj",method = RequestMethod.PUT)
    @ResponseBody
    public Map<String, Object> updateObj(@RequestBody @Valid QueryApkVersionListRequest queryApkVersionListRequest){
		Map<String, Object> respMap = baseBiz.updateById(queryApkVersionListRequest);
        return respMap;
    }
	
}